<?php
if(is_dir('install/') && !file_exists('install/install.lock')){
	header("Content-type: text/html; charset=utf-8");
	die ("<!DOCTYPE html><html lang=\"zh-CN\"><head>	
			<meta charset=\"utf-8\" />	
			<meta content=\"IE=edge,chrome=1\" http-equiv=\"X-UA-Compatible\" />	
			<title>系统检测到您尚未安装 Ocean X 系统</title>	
			<link rel=\"stylesheet\" href=\"install/css/install.css\" /></head>
			<body>	<div class=\"step step0\">		
			<p>系统检测到您尚未安装 Ocean X 系统</p>		
			<a href=\"install/install.php\" class=\"btn\">
			<i class=\"triangle\"></i>请点击进入安装页面</a>	
			</div></body></html>");
}
define('BUILD_DIR_SECURE',true);
define('DIR_SECURE_FILENAME', 'default.html');
define('DIR_SECURE_CONTENT', 'deney Access!');
if(!defined('SITE_PATH'))		define('SITE_PATH'	, getcwd());
if(!defined('SITE_DATA_PATH'))	define('SITE_DATA_PATH'	, SITE_PATH.'/data');
if(!defined('UPLOAD_PATH'))		define('UPLOAD_PATH'	, SITE_DATA_PATH.'/uploads');
if(!defined('APPS_PATH'))		define('APPS_PATH'	, SITE_PATH.'/apps');
if(!defined('SERVER_URL'))  	define('SERVER_URL','http://oceanx.yonglang.co');
if(isset($_GET['app'])){
	//判断开放的应用列表，进行必要的应用名过滤
	if(!preg_match('/^[a-zA-Z0-9_]+$/i',$_GET['app'])){
		die('参数错误!');
	}else{
		$app_name	=	strtolower($_GET['app']);
	}
}else{
	$app_name = 'admin';
}
define('THINK_PATH','./ocean/');
define('APP_NAME',$app_name);
define('RUNTIME_PATH' , './runtime/'.APP_NAME.'/' );
define('APP_PATH','./apps/'.APP_NAME.'/');
define('APP_DEBUG',true);

//注：该参数必须在sesson_start()之上，否则将不会生效(使得cookie和session能在不同的子域名之间共享)
//ini_set("session.cookie_domain",'.i8i8i8.com');
//session_start();


require THINK_PATH.'ocean.php';
?>